import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import ckw.config.PersistenceConfig;
import ckw.database.DatabaseService;
import ckw.database.DatabaseServiceImpl;
import ckw.election.ElectionService;
import ckw.election.ElectionServiceImpl;

@Configuration
@Import(value = PersistenceConfig.class)
public class DatabaseServiceConfig {
	@Autowired
	DatabaseService databaseService;

	@Autowired
	ElectionService electionService;

	@Bean
	public DatabaseService databaseService() {
		return new DatabaseServiceImpl();
	}

	@Bean
	public ElectionService electionService() {
		return new ElectionServiceImpl(databaseService);
	}

}
